package com.huluobo.a2212monthdemo

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.huluobo.a2212monthdemo.pages.HomePage
import com.huluobo.a2212monthdemo.pages.MessagePage
import com.huluobo.user.pages.MinePage
import com.huluobo.apps.pages.AppsPage
import com.huluobo.document.pages.DocumentPage
import com.huluobo.document.pages.LocalFilePage
import com.huluobo.lib_base.RoutePath
import com.huluobo.report.pages.ReportCommitPage
import com.huluobo.report.pages.ReportPage
import com.huluobo.sign.pages.SignCommitPage
import com.huluobo.sign.pages.SignListPage
import com.huluobo.user.pages.LoginPage
import com.huluobo.user.pages.RegisterPage

/**
 *  Created by LC on 2025/6/13.
 */
@Composable
fun MyNavHost(it: PaddingValues, navHostController: NavHostController) {
    NavHost(
        modifier = Modifier.padding(it),
        navController = navHostController,
        startDestination = RoutePath.HOME,
        builder = {
            composable(RoutePath.MESSAGE) { MessagePage() }
            composable(RoutePath.HOME) { HomePage(navHostController) }
            composable(RoutePath.MINE) { MinePage(navHostController) }
            composable(RoutePath.APPS) { AppsPage(navHostController = navHostController) }
            composable(RoutePath.DOCUMENT) { DocumentPage(navHostController = navHostController) }
            composable(RoutePath.LOCAL_FILE) { LocalFilePage(navHostController = navHostController) }
            composable(RoutePath.REPORT) { ReportPage(navHostController = navHostController) }
            composable(RoutePath.REPORT_COMMIT + "/{report}") {
                val report = it.arguments?.getString("report").toString()
                ReportCommitPage(navHostController = navHostController, json = report)
            }
            composable(RoutePath.SIGN_LIST) { SignListPage(navHostController = navHostController) }
            composable(RoutePath.SIGN_COMMIT) { SignCommitPage(navHostController = navHostController) }
            composable(RoutePath.REGISTER) { RegisterPage(navHostController = navHostController) }
            composable(RoutePath.LOGIN){ LoginPage(navHostController = navHostController)}
        })
}